<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2024/12/20
  Time: 15:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="com.shenyun.pojo.Student" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>学生管理系统-学生列表</title>
<jsp:include page="/conme/had.jsp" flush="true" />
            <!--开始::内容-->
            <div class="clear mt-20 mr-15 ml-15">
                <div class="fl">
                    <button class="btn btn-warning" onclick="location.href = '/student/addStudent' "><i class="icon-cog"></i>新增</button>
                    <button class="btn btn-danger" onclick="nudop()"><i class="icon-trash"></i>删除</button>
                    <button class="btn btn-disabled" onclick="location.href = '/student/StudentAll' "><i class="icon-remove-sign"></i>更新</button>
                </div>
                <div class="fr input-group">
                    <form action="/student/StudentById" method="get">
                        <input type="text" class="form-control" name="number" placeholder="输入学号" style="width:290px;"/>
                        <button class="btn btn-secondary">搜索</button>
                    </form>
                </div>
            </div>
            <table class="table table-bordered mr-15 ml-15 mt-15">

                <thead>
                <tr class="cen">
                    <th>学号</th>
                    <th>姓名</th>
                    <th>年级</th>
                    <th>班级</th>
                    <th>性别</th>
                    <th>年龄</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="list">
                <c:forEach items="${studentlist}" var="st">
                    <tr class="cen">
                        <td>${st.number}</td>
                        <td>${st.name}</td>
                        <td>${st.grade}</td>
                        <td>${st.clbum}</td>
                        <td>${st.gender}</td>
                        <td>${st.age}</td>
                        <td>
                            <a href="/student/UpdateStudent?number=${st.number}">修改</a>
                            <a onclick="deletop(${st.number})">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
            <div class="pagination fr"></div>
            <!--结束::内容-->
<jsp:include page="/conme/footd.jsp" flush="true" />
</body>
    <script>
        //待开发提示
        function nudop(){
            alert("联系月月开发吧！")
        }
        ///删除
        function deletop(id){
            layer.confirm('确定删除用户吗？', {
                title:'系统提示',
                btn: ['确定','取消']
            }, function(){
                location.href = '/student/deleteStudent?number='+id;
            });
        }
    </script>
</html>
